<!DOCTYPE html>
<html>
	<head>
		<link rel="stylesheet" href="../../codebase/webix.css" type="text/css" media="screen" charset="utf-8">
		<script src="../../codebase/webix.js" type="text/javascript" charset="utf-8"></script>
		
		<script type="text/javascript" src="../common/testdata.js"></script>
		<title>Drag and Drop with Drag Handle</title>
	</head>
	<style type="text/css">
		html, body{
			height:100%;
		}
		#listA, #listB, #listC{
			float:left; margin:20px;
		}
		.mark{
			width:100px;
			text-align: center;
			font-weight:bold;
			float:right;
			background-color:#444;
			color:white;
			border-radius:3px;
		}
	</style>
	<body>
		<div id="listA"></div>
		<div id="listB"></div>

		<style type="text/css">
			.webix_drag_handle{
				background-image:url(./handle.png);
				background-repeat: no-repeat;
				background-position: -2px 3px;
				width:20px;
				height:20px;
				cursor:n-resize; float:left;
			}
		</style>

		<script type="text/javascript" charset="utf-8">
			webix.ui({
				container:"listA",
				view:"list", 
				width:320,
				height:600,

				template:"<div class='mark'>#votes# </div> #rank#. #title#",
				type:{
					height:50, width:320
				},
				select:true, drag:"order",

				data:webix.copy(big_film_set)
			});	

			webix.ui({
				container:"listB",
				view:"list", 
				width:320,
				height:600,

				template:"<div class='mark'>#votes# </div> #rank#. <div class='webix_drag_handle'></div> #title#",
				type:{
					height:50, width:320
				},
				select:true, drag:"order",
				on:{
					onBeforeDrag:function(data, e){
						return (e.target||e.srcElement).className == "webix_drag_handle";
					}
				},

				data:webix.copy(big_film_set)
			});	
			
		</script>
	</body>
</html>